import {request} from '@/utils/request';

// 特产产品列表
export const specialtyProductList = <T>(data?:T) => {
    return request({
        url: "merchant/mall/product/client/pageList",
        method: "POST",
        data,
    });
};

/*merchant/product/mall/client/pageList   --- 首页商品列表
merchant/product/mall/client/details    --- 商品详情
merchant/product/mall/client/detailsText  --- 商品详情富文本
merchant/mall/client/details ---店铺详情*/


// 特产产品详情
export const specialtyProductDetail = <T>(data?:T) => {
    return request({
        url: "merchant/mall/product/client/details",
        method: "GET",
        data,
    });
};

// 特产下单产品详情
export const reservationSpecialtyDetail = <T>(data?:T) => {
    return request({
        url: "order/client/mall/goPlaceOrder",
        method: "POST",
        data,
        isFormData: true
    });
};

// 创建特产订单
export const createSpeciality = <T>(data?:T) => {
    return request({
        url: "order/client/mall/createMallOrder",
        method: "POST",
        data,
    });
};

// 收货信息列表
export const touristAddressListApi = <T>(data?:T) => {
    return request({
        url: "app/user/client/address",
        method: "GET",
        data,
    });
};

// 新增收货地址
export const addTouristAddress = <T>(data?:T) => {
    return request({
        url: "app/user/client/address",
        method: "POST",
        data,
    });
};

// 设置默认收货地址
export const setDefaultTouristAddress = <T>(data?:T) => {
    return request({
        url: "app/user/client/address/updateDefault",
        method: "PUT",
        data,
        isFormData: true
    });
};

// 删除收货信息
export const deleteTouristAddressApi = <T>(data?:T) => {
    return request({
        url: "app/user/client/address",
        method: "DELETE",
        data,
        isFormData: true
    });
};

// 修改收货地址信息
export const editorTouristAddress = <T>(data?:T) => {
    return request({
        url: "app/user/client/address",
        method: "PUT",
        data,
    });
};

// 取消订单
export const cancelOrder = <T>(data?:T) => {
    return request({
        url: "order/manger/mall/cancelMallOrder",
        method: "POST",
        data,
    });
};

// 修改订单详情收货地址
export const editorOrderDetailTouristAddress = <T>(data?:T) => {
    return request({
        url: "order/client/mall/updateAddress",
        method: "POST",
        data,
    });
};

// 订单发起售后
export const orderAfterSales = <T>(data?:T) => {
    return request({
        url: "order/refund/client/mall/initiateAfterSales",
        method: "POST",
        data,
    });
};
// 订单确认收货
export const confirmOrder = <T>(data?:T) => {
    return request({
        url: "order/client/mall/confirmMallOrder",
        method: "POST",
        data,
    });
};

// 售后详情
export const afterSalesDetail = <T>(data?:T) => {
    return request({
        url: "order/refund/client/mall/afterSalesDetails",
        method: "POST",
        data,
    });
};

// 撤销售后
export const revokeRefund = <T>(data?:T) => {
    return request({
        url: "order/refund/client/mall/revokeRefund",
        method: "POST",
        data,
    });
};

